Conversation
…vice handler delegates Co-authored-by: gensyn <36128035+gensyn@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Discuss coordinator use for SSH calls
refactor: introduce SshCommandCoordinator — coordinator owns I/O, service handler delegates
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
executeservice handler in__init__.pywas performing all SSH I/O inline, violating the standard HA pattern where a coordinator owns I/O and callers are pure dispatchers.Changes
coordinator.py(new)SshCommandCoordinatorowns all SSH I/O for the integrationasync_execute(data)— connection, command execution, and error mapping_resolve_known_hosts(...)— moved from__init__.py__init__.pyasync_setup_entrycreatesSshCommandCoordinator(hass)and stores it athass.data[DOMAIN][entry.entry_id]async_unload_entryremoves itTests
test_async_execute.py— patches updated tossh_command.coordinator.*;asyncSetUpnow callsasync_setup_entryto wire up the coordinatortest_async_setup.py— added assertions for coordinator creation/removaltest/test_coordinator.py(new) — unit tests forasync_executeerror paths and_resolve_known_hostsOriginal prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.